package com.aaa.phone.service.accountsafeservice.impl;

import com.aaa.phone.dao.accountsafedao.IAccountSafeDao;
import com.aaa.phone.service.accountsafeservice.AccountSafeService;
import com.aaa.phone.systemconst.ISystemConst;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Description: 更改用户手机号service实现类
 * @Author: 陈阳
 * @CreateDate: 2018/12/20$ 20:34$
 */
@Transactional
@Service
public class AccountSafeServiceImpl implements AccountSafeService,ISystemConst {

    @Autowired
    private IAccountSafeDao dao;

    /**
     * 更改用户手机号
     */
    @Override
    public int updateTelUserLogin(String agoTelephone, String nowTelephone) {
        int updateTelUserLogin = dao.updateTelUserLogin(agoTelephone, nowTelephone);
        int updateTelUserInfo = dao.updateTelUserInfo(agoTelephone, nowTelephone);
        if(updateTelUserLogin==ONE && updateTelUserInfo==ONE){
            return SUCCESS_CODE;
        }
        return DEFEAT_CODE;
    }

}
